<!DOCTYPE html>
<html lang="zh">
	<head>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<title>运行日志</title>
		<link rel="shortcut icon" href="favicon.ico">
		<link href="../static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="../static/css/font-awesome.min.css" rel="stylesheet" />
		<!-- bootstrap-table 表格插件样式 -->
		<link href="../static/ajax/libs/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
		<link href="../static/css/animate.css" rel="stylesheet" />
		<link href="../static/css/style.css" rel="stylesheet" />
		<link href="../static/ruoyi/css/ry-ui.css" rel="stylesheet" />


		<link href="../static/ajax/libs/jquery-layout/jquery.layout-latest.css" rel="stylesheet" />


		<link href="../static/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css" rel="stylesheet" />

	</head>
	<body class="gray-bg">

		<div class="ui-layout-center">
			<div class="container-div">
				<div class="row">
					<div class="col-sm-12 search-collapse">
						<form id="user-form">
							<input type="hidden" id="deptId" name="deptId">
							<input type="hidden" id="parentId" name="parentId">
							<div class="select-list">
								<ul>

									<li class="select-time">
										<label>时间： </label>
										<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]" />
										<span>-</span>
										<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]" />
									</li>
									<li>
										<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()">
											<i class="fa fa-search"></i>&nbsp;搜索
										</a>
										<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()">
											<i class="fa fa-refresh"></i>&nbsp;重置
										</a>
									</li>
								</ul>
							</div>
						</form>
					</div>


					<div class="col-sm-12 select-table table-striped">
						<div class="bootstrap-table">
							<div class="fixed-table-toolbar">
								<div class="bs-bars pull-left">
									<div class="btn-group-sm" id="toolbar" role="group">
										<a class="btn btn-success" onclick="">
											<i class="fa fa-download"></i> 批量导出
										</a>
										<a class="btn btn-info" onclick="">
											<i class="fa fa-upload"></i> 导入
										</a>
									</div>
								</div>
							</div>


							<div class="fixed-table-container" style="padding-bottom: 0px;">
								<div class="fixed-table-header" style="display: none;">
									<table></table>
								</div>
								<div class="fixed-table-body">
									<table id="bootstrap-table" data-mobile-responsive="true" class="table table-hover">
										<thead>
											<tr>
												<th class="bs-checkbox " style="width: 36px; " data-field="0" tabindex="0">
													<div class="th-inner "><input name="btSelectAll" type="checkbox"></div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">
														#
													</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">出库茶叶批次</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">生产批次</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">生产设备编号</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">记录员</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">生产类别</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">记录时间</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">生产状态</div>
													<div class="fht-cell"></div>
												</th>
												<th>
													<div class="th-inner ">操作</div>
													<div class="fht-cell"></div>
												</th>
											</tr>
										</thead>

										<tbody>
											<tr data-index="0">
												<td class="bs-checkbox ">
													<input data-index="1" name="btSelectItem" type="checkbox">
												</td>
												<td>1</td>
												<td>K2019072101</td>
												<td>S2019072101</td>
												<td>D2019071701</td>
												<td>张三</td>
												<td>杀青</td>
												<td>2019-7-22 18:26:22</td>
												<td><span class="badge badge-primary">合格</span></td>
												<td>
													<button class="btn btn-info btn-primary btn-xs" data-toggle="modal" data-target="#myModal5" " type="
													 button">
														<i class="fa fa-key"></i>&nbsp;&nbsp;<span class="bold">详细</span>
													</button>
													<button class="btn btn-success btn-xs" type="button">
														<i class="fa fa-download"></i>&nbsp;&nbsp;<span class="bold">导出</span>
													</button>
												</td>
											</tr>
											<tr data-index="1">
												<td class="bs-checkbox ">
													<input data-index="1" name="btSelectItem" type="checkbox">
												</td>
												<td>2</td>
												<td>K2019072101</td>
												<td>R2019072101</td>
												<td>D2019071711</td>
												<td>张三</td>
												<td>揉捻</td>
												<td>2019-7-22 18:26:22</td>
												<td><span class="badge badge-primary">合格</span></td>
												<td>
													<button class="btn btn-info btn-primary btn-xs" data-toggle="modal" data-target="#myModal5" " type="
													 button">
														<i class="fa fa-key"></i>&nbsp;&nbsp;<span class="bold">详细</span>
													</button>
													<button class="btn btn-success btn-xs" type="button">
														<i class="fa fa-download"></i>&nbsp;&nbsp;<span class="bold">导出</span>
													</button>
												</td>
											</tr>
										</tbody>
									</table>

								</div>
								<div class="fixed-table-footer" style="display: none;">
									<table>
										<tbody>
											<tr></tr>
										</tbody>
									</table>
								</div>
								<div class="fixed-table-pagination" style="display: block;">
									<div class="pull-left pagination-detail">
										<span class="pagination-info">第 1 到 2 条，共 2 条记录。</span>
										<span class="page-list" style="display: none;">
											<span class="btn-group dropup">
												<button type="button" class="btn btn-default btn-outline dropdown-toggle" data-toggle="dropdown">
													<span class="page-size">10</span>
													<span class="caret"></span>
												</button>
												<ul class="dropdown-menu" role="menu">
													<li class="active">
														<a href="javascript:void(0)">10</a>
													</li>
												</ul>
											</span> 条记录每页</span>
									</div>
									<div class="pull-right pagination" style="display: none;">
										<ul class="pagination pagination-outline">
											<li class="page-pre"><a href="javascript:void(0)">‹</a></li>
											<li class="page-number active"><a href="javascript:void(0)">1</a></li>
											<li class="page-next"><a href="javascript:void(0)">›</a></li>
										</ul>
									</div>
								</div>
							</div>



						</div>
						<div class="clearfix"></div>
					</div>


				</div>
			</div>
		</div>
		<div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span>
						</button>
						<h4 class="modal-title">XXXXX生产记录详细</h4>
						<small class="font-bold">
							记录人员：张三&nbsp;&nbsp;记录时间：2019-7-22 18:26:22
						</small>
					</div>
					<small class="font-bold">
						<div class="modal-body">
							这里是对生产记录的详细数据展示，用户可以在右下角选择导出和关闭操作
						</div>

						<div class="modal-footer">
							<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
							<button type="button" class="btn btn-primary">导出</button>
						</div>
					</small>
				</div><small class="font-bold">
				</small>
			</div><small class="font-bold">
			</small>
		</div>

		<script src="../static/js/jquery.min.js"></script>
		<script src="../static/js/bootstrap.min.js"></script>
		<!-- bootstrap-table 表格插件 -->
		<script src="../static/ajax/libs/bootstrap-table/bootstrap-table.min.js"></script>
		<script src="../static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
		<script src="../static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js"></script>
		<script src="../static/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>
		<script src="../static/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js"></script>
		<!-- jquery-validate 表单验证插件 -->
		<script src="../static/ajax/libs/validate/jquery.validate.min.js"></script>
		<script src="../static/ajax/libs/validate/messages_zh.min.js"></script>
		<script src="../static/ajax/libs/validate/jquery.validate.extend.js"></script>
		<!-- jquery-validate 表单树插件 -->
		<script src="../static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>
		<!-- jquery-export 表格导出插件 -->
		<script src="../static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js"></script>
		<script src="../static/ajax/libs/bootstrap-table/extensions/export/tableExport.js"></script>
		<!-- 遮罩层 -->
		<script src="../static/ajax/libs/blockUI/jquery.blockUI.js"></script>
		<script src="../static/ajax/libs/iCheck/icheck.min.js"></script>
		<script src="../static/ajax/libs/layer/layer.min.js"></script>
		<script src="../static/ajax/libs/layui/layui.js"></script>
		<script src="../static/ruoyi/js/common.js?v=4.0.0"></script>
		<script src="../static/ruoyi/js/ry-ui.js?v=4.0.0"></script>
		<script> var ctx = "\/"; </script>


		<script src="../static/ajax/libs/jquery-layout/jquery.layout-latest.js"></script>


		<script src="../static/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js"></script>

		<script>
			var editFlag = "";
    var removeFlag = "";
    var resetPwdFlag = "";
    var prefix = ctx + "system/user";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 185});
        //queryUserList();
        //queryDeptTree();
    });

    function queryUserList() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            importUrl: prefix + "/importData",
            importTemplateUrl: prefix + "/importTemplate",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "用户",
            columns: [{
                checkbox: true
            },
                {
                    field: 'userId',
                    title: '用户ID'
                },
                {
                    field: 'loginName',
                    title: '登录名称',
                    sortable: true
                },
                {
                    field: 'userName',
                    title: '用户名称'
                },
                {
                    field: 'dept.deptName',
                    title: '部门'
                },
                {
                    field: 'email',
                    title: '邮箱',
                    visible: false
                },
                {
                    field: 'phonenumber',
                    title: '手机'
                },
                {
                    visible: editFlag == 'hidden' ? false : true,
                    title: '用户状态',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return statusTools(row);
                    }
                },
                {
                    field: 'createTime',
                    title: '创建时间',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
                        actions.push('<a class="btn btn-info btn-xs ' + resetPwdFlag + '" href="javascript:void(0)" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    }

    function queryDeptTree() {
        var url = ctx + "system/dept/treeData";
        var options = {
            url: url,
            expandLevel: 2,
            onClick: zOnClick
        };
        $.tree.init(options);

        function zOnClick(event, treeId, treeNode) {
            $("#deptId").val(treeNode.id);
            $("#parentId").val(treeNode.pId);
            $.table.search();
        }
    }

    $('#btnExpand').click(function () {
        $._tree.expandAll(true);
        $(this).hide();
        $('#btnCollapse').show();
    });

    $('#btnCollapse').click(function () {
        $._tree.expandAll(false);
        $(this).hide();
        $('#btnExpand').show();
    });

    $('#btnRefresh').click(function () {
        queryDeptTree();
    });

    /* 用户管理-部门 */
    function dept() {
        var url = ctx + "system/dept";
        $.modal.openTab("部门管理", url);
    }

    /* 用户管理-重置密码 */
    function resetPwd(userId) {
        var url = prefix + '/resetPwd/' + userId;
        $.modal.open("重置密码", url, '800', '300');
    }

    /* 用户状态显示 */
    function statusTools(row) {
        if (row.status == 1) {
            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
        } else {
            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
        }
    }

    /* 用户管理-停用 */
    function disable(userId) {
        $.modal.confirm("确认要停用用户吗？", function () {
            $.operate.post(prefix + "/changeStatus", {"userId": userId, "status": 1});
        })
    }

    /* 用户管理启用 */
    function enable(userId) {
        $.modal.confirm("确认要启用用户吗？", function () {
            $.operate.post(prefix + "/changeStatus", {"userId": userId, "status": 0});
        })
    }
</script>
	</body>
	<!-- 导入区域 -->
	<script id="importTpl" type="text/template">
		<form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在，更新这条数据。"> 是否更新已经存在的用户数据
                &nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i
                    class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>
</html>
